home *** CD-ROM | disk | FTP | other *** search
- /*««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««*/
- /* I N C L U D E S */
- /*««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««*/
- #include <exec/types.h> // For UBYTE etc.
- #include <clib/exec_protos.h> // Protos for CopyMem() etc.
- #include <clib/gadtools_protos.h> // Protos for GT_SetGadgetAttrs() etc.
- #include <dos/notify.h> // For notification structs etc.
- #include <intuition/gadgetclass.h> // Misc defines etc.
- #include <libraries/gadtools.h> // For gadtools structures etc.
- #include <pragmas/exec_pragmas.h> // Pragmas for exec.library.
- #include <pragmas/gadtools_pragmas.h> // Pragmas for gadtools.library.
- #include <stdlib.h> // Protos for atoi() etc.
- #include <string.h> // Protos for strcpy() etc.
-
- #include "WatcherPrefs.h" // GadTools generated.
- #include "/Include/Defines.h" // Gadget defines etc.
- #include "/Include/Prefs.h" // For WPrefs structure.
-
- /*««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««*/
- /* I M P O R T S */
- /*««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««*/
- /*------------*/
- /* Variables: */
- /*------------*/
- extern ULONG What; // Determines wheter a checkmark is active.
- extern struct WPrefs *WPrefs; // Main preference settings.
- extern struct WPrefs *WPrefsBack; // Backup for restore purposes.
- extern struct Requester SleepReq; // For SleepWindow() etc.
- /*------------*/
- /* Functions: */
- /*------------*/
- extern BOOL ReadPrefs (UBYTE *fname);
- extern BOOL WritePrefs (UBYTE *fname);
- extern void CorrectGadgets (struct WPrefs *wprefs);
- extern void UsePrefsDefaults (void);
- extern BOOL Inform (struct Window *w, STRPTR Title, STRPTR Text, APTR args);
- extern BOOL RequestPrefFile (UBYTE *startdir, UBYTE *startfile, UBYTE *resultpath, UBYTE *title);
- extern void SplitPath (STRPTR FullPath, STRPTR PathPart, STRPTR NamePart);
- extern BOOL SleepWindow (struct Window *w, struct Requester *r);
- extern void WakeUpWindow (struct Window *w, struct Requester *r);
-
- /*««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««*/
- /* F U N C T I O N S */
- /*««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««*/
- // This file contains empty template routines that the IDCMP handler
- // will call uppon. Fill out these routines with your code or use them
- // as a reference to create your program.
-
- int VOLUMESClicked( void )
- {
- /* routine when gadget "Volumes:" is clicked. */
-
- /*-------------*/
- /* L O C A L S */
- /*-------------*/
- UBYTE *s, scopy [256];
- ULONG SCount = 0;
-
- /*---------*/
- /* C O D E */
- /*---------*/
- strcpy (WPrefs->wp_VolNameStrGad,
- ((struct StringInfo *) WatcherPrefsGadgets [GD_VOLUMES]->SpecialInfo)->Buffer);
- s = WPrefs->wp_VolNameStrGad;
-
- while (*s)
- {
- switch (*s)
- {
- case ':' :
- {
- scopy [SCount++] = ':'; // Copy also ':' into scopy.
- scopy [SCount] = '\0'; // NULL terminate scopy.
- strcpy (WPrefs->wp_VolName [WPrefs->wp_VolCount], scopy);
- scopy [SCount = 0] = '\0'; // NULL scopy.
- *s++; // Advance one character.
- if (*s == '-') // Check for indicator.
- {
- *s++;
- if ((*s == 'b') || (*s == 'B'))
- {
- WPrefs->wp_VolNameType [WPrefs->wp_VolCount] = VBYTE;
- }
- if ((*s == 'k') || (*s == 'K'))
- {
- WPrefs->wp_VolNameType [WPrefs->wp_VolCount] = VKILOBYTE;
- }
- if ((*s == 'm') || (*s == 'M'))
- {
- WPrefs->wp_VolNameType [WPrefs->wp_VolCount] = VMEGABYTE;
- }
- if ((*s == 'a') || (*s == 'A'))
- {
- WPrefs->wp_VolNameType [WPrefs->wp_VolCount] = VAUTO;
- }
- }
- WPrefs->wp_VolCount++;
- *s++;
- break;
- }
- case ',' :
- {
- *s++;
- scopy [SCount = 0] = '\0';
- break;
- }
- case '-' :
- {
- break;
- }
- default :
- {
- scopy [SCount++] = *s++;
- break;
- }
- }
- }
- return (1);
- }
-
- int TOTALClicked( void )
- {
- /* routine when gadget "Total Memory:" is clicked. */
- if (WatcherPrefsGadgets [GD_TOTAL]->Flags & SELECTED)
- {
- WPrefs->wp_Total = TRUE;
- }
- else
- {
- WPrefs->wp_Total = FALSE;
- }
- return (1);
- }
-
- int FASTClicked( void )
- {
- /* routine when gadget "Fast Memory:" is clicked. */
- if (WatcherPrefsGadgets [GD_FAST]->Flags & SELECTED)
- {
- WPrefs->wp_Fast = TRUE;
- }
- else
- {
- WPrefs->wp_Fast = FALSE;
- }
- return (1);
- }
-
- int CHIPClicked( void )
- {
- /* routine when gadget "Chip Memory:" is clicked. */
- if (WatcherPrefsGadgets [GD_CHIP]->Flags & SELECTED)
- {
- WPrefs->wp_Chip = TRUE;
- }
- else
- {
- WPrefs->wp_Chip = FALSE;
- }
- return (1);
- }
-
- int LARGESTClicked( void )
- {
- /* routine when gadget "Largest Mem. Block:" is clicked. */
- if (WatcherPrefsGadgets [GD_LARGEST]->Flags & SELECTED)
- {
- WPrefs->wp_Largest = TRUE;
- }
- else
- {
- WPrefs->wp_Largest = FALSE;
- }
- return (1);
- }
-
- int LARGESTFASTClicked( void )
- {
- /* routine when gadget "Largest Fast Block:" is clicked. */
- if (WatcherPrefsGadgets [GD_LARGESTFAST]->Flags & SELECTED)
- {
- WPrefs->wp_LargestFast = TRUE;
- }
- else
- {
- WPrefs->wp_LargestFast = FALSE;
- }
- return (1);
- }
-
- int LARGESTCHIPClicked( void )
- {
- /* routine when gadget "Largest Chip Block:" is clicked. */
- if (WatcherPrefsGadgets [GD_LARGESTCHIP]->Flags & SELECTED)
- {
- WPrefs->wp_LargestChip = TRUE;
- }
- else
- {
- WPrefs->wp_LargestChip = FALSE;
- }
- return (1);
- }
-
- int DAYOFWEEKClicked( void )
- {
- /* routine when gadget ":Day of week" is clicked. */
- if (WatcherPrefsGadgets [GD_DAYOFWEEK]->Flags & SELECTED)
- {
- WPrefs->wp_DayOfWeek = TRUE;
- }
- else
- {
- WPrefs->wp_DayOfWeek = FALSE;
- }
- return (1);
- }
-
- int DATEClicked( void )
- {
- /* routine when gadget ":Date" is clicked. */
- if (WatcherPrefsGadgets [GD_DATE]->Flags & SELECTED)
- {
- WPrefs->wp_Date = TRUE;
- }
- else
- {
- WPrefs->wp_Date = FALSE;
- }
- return (1);
- }
-
- int TIMEClicked( void )
- {
- /* routine when gadget ":Time" is clicked. */
- if (WatcherPrefsGadgets [GD_TIME]->Flags & SELECTED)
- {
- WPrefs->wp_Time = TRUE;
- }
- else
- {
- WPrefs->wp_Time = FALSE;
- }
- return (1);
- }
-
- int WINLEFTEDGEClicked( void )
- {
- /* routine when gadget "Window LeftEdge:" is clicked. */
- WPrefs->wp_WinLeftEdge = atoi (((struct StringInfo *)
- WatcherPrefsGadgets [GD_WINLEFTEDGE]->SpecialInfo)->Buffer);
- return (1);
- }
-
- int WINTOPEDGEClicked( void )
- {
- /* routine when gadget "Window TopEdge:" is clicked. */
- WPrefs->wp_WinTopEdge = atoi (((struct StringInfo *)
- WatcherPrefsGadgets [GD_WINTOPEDGE]->SpecialInfo)->Buffer);
- return (1);
- }
-
- int WINWIDTHClicked( void )
- {
- /* routine when gadget "Window Width:" is clicked. */
- WPrefs->wp_WinWidth = atoi (((struct StringInfo *)
- WatcherPrefsGadgets [GD_WINWIDTH]->SpecialInfo)->Buffer);
- return (1);
- }
-
- int UPDATESECClicked( void )
- {
- /* routine when gadget "Update rate sec.:" is clicked. */
- WPrefs->wp_UpdateSec = atoi (((struct StringInfo *)
- WatcherPrefsGadgets [GD_UPDATESEC]->SpecialInfo)->Buffer);
-
- if ((WPrefs->wp_UpdateSec < 1) && (WPrefs->wp_UpdateMic == 0))
- {
- Inform (WatcherPrefsWnd, "Error", "Your can't have zeroes in both seconds and\n"
- "microseconds. Specify at least one of the\n"
- "two.", NULL);
- }
- return (1);
- }
-
- int UPDATEMICClicked( void )
- {
- /* routine when gadget "Update rate mic.:" is clicked. */
- WPrefs->wp_UpdateMic = atoi (((struct StringInfo *)
- WatcherPrefsGadgets [GD_UPDATEMIC]->SpecialInfo)->Buffer);
-
- if ((WPrefs->wp_UpdateMic < 1) && (WPrefs->wp_UpdateSec == 0))
- {
- Inform (WatcherPrefsWnd, "Error", "Your can't have zeroes in both seconds and\n"
- "microseconds. Specify at least one of the\n"
- "two.", NULL);
- }
- return (1);
- }
-
- int NOJUMPGADGETClicked( void )
- {
- /* routine when gadget ":No Jump Gadget" is clicked. */
- if (WatcherPrefsGadgets [GD_NOJUMPGADGET]->Flags & SELECTED)
- {
- WPrefs->wp_NoJumpGadget = TRUE;
- }
- else
- {
- WPrefs->wp_NoJumpGadget = FALSE;
- }
- return (1);
- }
-
- int CPUClicked( void )
- {
- /* routine when gadget ":CPU load" is clicked. */
- if (WatcherPrefsGadgets [GD_CPU]->Flags & SELECTED)
- {
- WPrefs->wp_Cpu = TRUE;
- }
- else
- {
- WPrefs->wp_Cpu = FALSE;
- }
- return (1);
- }
-
- int PUBLICSCREENClicked( void )
- {
- /* routine when gadget "Public Screen:" is clicked. */
- strcpy (WPrefs->wp_PubScreen,
- ((struct StringInfo *) WatcherPrefsGadgets [GD_PUBLICSCREEN]->SpecialInfo)->Buffer);
- return (1);
- }
-
- int GUIDEFILEClicked( void )
- {
- /* routine when gadget "Guide file:" is clicked. */
- strcpy (WPrefs->wp_GuideFile,
- ((struct StringInfo *) WatcherPrefsGadgets [GD_GUIDEFILE]->SpecialInfo)->Buffer);
- return (1);
- }
-
- int VOLUMEFREEDIRECTIONClicked( void )
- {
- /* routine when gadget ":Vol. Free Dir." is clicked. */
- if (WatcherPrefsGadgets [GD_VOLUMEFREEDIRECTION]->Flags & SELECTED)
- {
- WPrefs->wp_VolumeFreeDirection = TRUE;
- GT_SetGadgetAttrs (WatcherPrefsGadgets [GD_VOLUMEFREEDIRECTIONINDICATORS],
- WatcherPrefsWnd, NULL,
- GA_Disabled, FALSE,
- TAG_END);
- }
- else
- {
- WPrefs->wp_VolumeFreeDirection = FALSE;
- GT_SetGadgetAttrs (WatcherPrefsGadgets [GD_VOLUMEFREEDIRECTIONINDICATORS],
- WatcherPrefsWnd, NULL,
- GA_Disabled, TRUE,
- TAG_END);
- }
- return (1);
- }
-
- int VOLUMEFREEDIRECTIONINDICATORSClicked( void )
- {
- /* routine when gadget "Volume Free Indicators" is clicked. */
- strcpy (WPrefs->wp_VolumeFreeDirectionInd,
- ((struct StringInfo *)
- WatcherPrefsGadgets [GD_VOLUMEFREEDIRECTIONINDICATORS]->SpecialInfo)->Buffer);
- return (1);
- }
-
- int VOLUMALERTClicked( void )
- {
- /* routine when gadget "Volume Alert:" is clicked. */
- strcpy ((UBYTE *) WPrefs->wp_VolAlertStrGad,
- ((struct StringInfo *) WatcherPrefsGadgets [GD_VOLUMALERT]->SpecialInfo)->Buffer);
- return (1);
- }
-
- int SAVEClicked( void )
- {
- /* routine when gadget "_Save" is clicked. */
- if (!(WritePrefs ("ENVARC:Watcher.prefs")))
- {
- Inform (WatcherPrefsWnd, "Error:", "Can't write to ENVARC:Watcher.prefs", NULL);
- }
- if (!(WritePrefs ("ENV:Watcher.prefs")))
- {
- Inform (WatcherPrefsWnd, "Error:", "Can't write to ENV:Watcher.prefs", NULL);
- }
- return (0);
- }
-
- int USEClicked( void )
- {
- /* routine when gadget "_Use" is clicked. */
- WritePrefs ("ENV:Watcher.prefs");
- return (0);
- }
-
- int CANCELClicked( void )
- {
- /* routine when gadget "_Cancel" is clicked. */
- return (0);
- }
-
- int GUIDEFILEGETClicked( void )
- {
- /* routine when gadget "" is clicked. */
- /*-------------*/
- /* L O C A L S */
- /*-------------*/
- UBYTE resultpath [256];
- UBYTE dir [256];
- UBYTE file [256];
-
- /*---------*/
- /* C O D E */
- /*---------*/
- /*----------------------*/
- /* Reset our variables. */
- /*----------------------*/
- dir [0] = '\0';
- file [0] = '\0';
-
- /*-----------------------------------------------------------------------------------*/
- /* Split the path from the string gadget into components suitable for asl requester. */
- /*-----------------------------------------------------------------------------------*/
- SplitPath (((struct StringInfo *) WatcherPrefsGadgets [GD_GUIDEFILE]->SpecialInfo)->Buffer,
- dir, file);
-
- /*-------------------*/
- /* Put up requester. */
- /*-------------------*/
- SleepWindow (WatcherPrefsWnd, &SleepReq);
- if (RequestPrefFile (dir, file, resultpath, "Choose Watcher guide file."))
- {
- strcpy ((UBYTE *) WPrefs->wp_GuideFile, resultpath);
- CorrectGadgets (WPrefs);
- }
- WakeUpWindow (WatcherPrefsWnd, &SleepReq);
- return (1);
- }
-
- int APPINFOAUTOSTARTClicked( void )
- {
- /* routine when gadget "App Info autostart:" is clicked. */
- if (WatcherPrefsGadgets [GD_APPINFOAUTOSTART]->Flags & SELECTED)
- {
- WPrefs->wp_AppInfoAutoStart = TRUE;
- }
- else
- {
- WPrefs->wp_AppInfoAutoStart = FALSE;
- }
- return (1);
- }
-
- int APPINFOLEFTEDGEClicked( void )
- {
- /* routine when gadget "App Info Left Edge:" is clicked. */
- WPrefs->wp_AppInfoLeftEdge = atoi (((struct StringInfo *)
- WatcherPrefsGadgets [GD_APPINFOLEFTEDGE]->SpecialInfo)->Buffer);
- return (1);
- }
-
- int APPINFOTOPEDGEClicked( void )
- {
- /* routine when gadget "App Info Top Edge:" is clicked. */
- WPrefs->wp_AppInfoTopEdge = atoi (((struct StringInfo *)
- WatcherPrefsGadgets [GD_APPINFOTOPEDGE]->SpecialInfo)->Buffer);
- return (1);
- }
-
- int LANGUAGEClicked( void )
- {
- /* routine when gadget "Language" is clicked. */
- WPrefs->wp_LanguageNum = WatcherPrefsMsg.Code;
- switch (WatcherPrefsMsg.Code)
- {
- case 0 : // dansk
- {
- strcpy (WPrefs->wp_Language, "dansk");
- break;
- }
- case 1 : // english
- case 2 : // internal
- {
- strcpy (WPrefs->wp_Language, "english");
- break;
- }
- }
- return (1);
- }
-
- int TIME_FORMATClicked( void )
- {
- /* routine when gadget ":24 hour clock" is clicked. */
- if (WatcherPrefsGadgets [GD_TIME_FORMAT]->Flags & SELECTED)
- {
- WPrefs->wp_TimeFormat24 = TRUE;
- }
- else
- {
- WPrefs->wp_TimeFormat24 = FALSE;
- }
- return (1);
- }
-
- int DATE_FORMATClicked( void )
- {
- /* routine when gadget "Date F.:" is clicked. */
- WPrefs->wp_DateFormat = WatcherPrefsMsg.Code;
- return (1);
- }
-
- int WatcherPrefsItem0( void )
- {
- /* routine when (sub)item "Open" is selected. */
- /*-------------*/
- /* L O C A L S */
- /*-------------*/
- UBYTE resultpath [256];
-
- /*---------*/
- /* C O D E */
- /*---------*/
- SleepWindow (WatcherPrefsWnd, &SleepReq);
- if (RequestPrefFile ("SYS:Prefs/Presets", "", resultpath, "Open preference"))
- {
- ReadPrefs (resultpath);
- CorrectGadgets (WPrefs);
- }
- WakeUpWindow (WatcherPrefsWnd, &SleepReq);
- return (1);
- }
-
- int WatcherPrefsItem1( void )
- {
- /* routine when (sub)item "Save as..." is selected. */
- /*-------------*/
- /* L O C A L S */
- /*-------------*/
- UBYTE resultpath [256];
-
- /*---------*/
- /* C O D E */
- /*---------*/
- SleepWindow (WatcherPrefsWnd, &SleepReq);
- if (RequestPrefFile ("SYS:Prefs/Presets", "", resultpath, "Save preferences as..."))
- {
- WritePrefs (resultpath);
- }
- WakeUpWindow (WatcherPrefsWnd, &SleepReq);
- return (1);
- }
-
- int WatcherPrefsItem2( void )
- {
- /* routine when (sub)item "Quit" is selected. */
- return (0);
- }
-
- int WatcherPrefsItem3( void )
- {
- /* routine when (sub)item "Reset to defaults" is selected. */
- UsePrefsDefaults ();
- CorrectGadgets (WPrefs);
- return (1);
- }
-
- int WatcherPrefsItem4( void )
- {
- /* routine when (sub)item "Last Saved" is selected. */
- if (!(ReadPrefs ("ENVARC:Watcher.prefs")))
- {
- if (!(ReadPrefs ("ENV:Watcher.prefs")))
- {
- Inform (WatcherPrefsWnd, "Error", "Can't find Watcher.prefs in either ENVARC:,"
- "nor ENV:.", NULL);
- return (1);
- }
- }
- CorrectGadgets (WPrefs);
- return (1);
- }
-
- int WatcherPrefsItem5( void )
- {
- /* routine when (sub)item "Restore" is selected. */
- CopyMem (WPrefsBack, WPrefs, sizeof (struct WPrefs));
- CorrectGadgets (WPrefs);
- return (1);
- }
-
- int WatcherPrefsItem6( void )
- {
- /* routine when (sub)item "Create Icons" is selected. */
- return (1);
- }
-
- int WatcherPrefsCloseWindow( void )
- {
- /* routine for "IDCMP_CLOSEWINDOW". */
- return (0);
- }
-
- int WatcherPrefsMenuHelp( void )
- {
- /* routine for "IDCMP_MENUHELP". */
- /*-------------*/
- /* L O C A L S */
- /*-------------*/
- ULONG menunum, itemnum;
-
- /*---------*/
- /* C O D E */
- /*---------*/
- menunum = MENUNUM (WatcherPrefsMsg.Code);
- itemnum = ITEMNUM (WatcherPrefsMsg.Code);
-
- switch (menunum)
- {
- case 0 : // Project.
- {
- switch (itemnum)
- {
- case 0 : // Open
- {
- Inform (WatcherPrefsWnd, "Help on - Open -",
- "This lets you open a Watcher preference file. Usually these\n"
- "reside in the SYS:Prefs/Presets drawer, where you can store\n"
- "different settings for Watcher.", NULL);
- break;
- }
- case 1 :
- {
- Inform (WatcherPrefsWnd, "Help on - Save as... -",
- "This lets you save the current settings to a file by your\n"
- "choice. Note that the suggested drawer is SYS:Prefs/Presets,\n"
- "which is also the drawer used by the Workbench preferences\n"
- "programs. In this drawer you can save different settings\n"
- "for different purposes.", NULL);
- break;
- }
- case 3 :
- {
- Inform (WatcherPrefsWnd, "Help on - Quit -",
- "This will quit WatcherPrefs without saving the preferences.", NULL);
- break;
- }
- }
- break;
- }
- case 1 : // Edit
- {
- switch (itemnum)
- {
- case 0 : // Reset to defaults
- {
- Inform (WatcherPrefsWnd, "Help on - Reset to defaults -",
- "This will reset the preference setting to WatcherPrefs'\n"
- "internal defaults.", NULL);
- break;
- }
- case 1 : // Last saved.
- {
- Inform (WatcherPrefsWnd, "Help on - Quit -",
- "This will load the preference settings from ENVARC:Watcher.prefs.", NULL);
- break;
- }
- case 3 : // Restore.
- {
- Inform (WatcherPrefsWnd, "Help on - Quit -",
- "Restore will set the preference settings as they were when you\n"
- "started the WatcherPrefs program. This option is useful if you\n"
- "would like to undo an incorrect save of the preferences.", NULL);
- break;
- }
- }
- break;
- }
- case 2 : // Settings
- {
- switch (itemnum)
- {
- case 0 : // Create Icons?
- {
- Inform (WatcherPrefsWnd, "Help on - Quit -",
- "This will switch between creating icons or not.", NULL);
- break;
- }
- }
- break;
- }
- }
- return (1);
- }
-
- int WatcherPrefsVanillaKey( void )
- {
- /* routine for "IDCMP_VANILLAKEY". */
- switch (WatcherPrefsMsg.Code)
- {
- case 's' :
- case 'S' : // Save.
- {
- WritePrefs ("ENVARC:Watcher.prefs");
- WritePrefs ("ENV:Watcher.prefs");
- return (0);
- break;
- }
- case 'u' :
- case 'U' :
- {
- WritePrefs ("ENV:Watcher.prefs");
- return (0);
- break;
- }
- case 'c' :
- case 'C' : // Cancel.
- {
- return (0);
- break;
- }
- }
- return (1);
- }
-
- int WatcherPrefsRawKey( void )
- {
- /* routine for "IDCMP_RAWKEY". */
- /*-------------*/
- /* L O C A L S */
- /*-------------*/
- UWORD x, y;
-
- /*---------*/
- /* C O D E */
- /*---------*/
- x = WatcherPrefsMsg.MouseX;
- y = WatcherPrefsMsg.MouseY;
-
- switch (WatcherPrefsMsg.Code)
- {
- case 95 :
- {
- /*-------------------*/
- /* Check GD_VOLUMES: */
- /*-------------------*/
- if (x >= 86 && x <= 270 && y >= 31 && y <= 44)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Volumes -",
- "Here you enter the names of the volumes you want to watch,\n"
- "separated with commas.\n\n"
- "Example: SYS:-a,WORK:-m\n\n"
- "Will display the free bytes for SYS: in automatic (-a) mode,\n"
- "which means Watcher is intelligent enough to choose between\n"
- "MB, KB and bytes depending on the free space. Furthermore,\n"
- "WORK: will be displayed with free space in megabytes (-m)", NULL);
- break;
- }
-
- /*-----------------*/
- /* Check GD_TOTAL: */
- /*-----------------*/
- if (x >= 434 && x <= 459 && y >= 84 && y <= 94)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Total -",
- "This gadget toggles between displaying the total amount of\n"
- "memory available on your system.", NULL);
- break;
- }
-
- /*----------------*/
- /* Check GD_FAST: */
- /*----------------*/
- if (x >= 434 && x <= 459 && y >= 73 && y <= 83)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Fast -",
- "This gadget toggles between displaying the total amount of\n"
- "*Fast* memory available on your system.", NULL);
- break;
- }
-
- /*----------------*/
- /* Check GD_CHIP: */
- /*----------------*/
- if (x >= 434 && x <= 459 && y >= 62 && y <= 72)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Chip -",
- "This gadget toggles between displaying the total amount of\n"
- "*Chip* memory available on your system.", NULL);
- break;
- }
-
- /*-------------------*/
- /* Check GD_LARGEST: */
- /*-------------------*/
- if (x >= 434 && x <= 459 && y >= 51 && y <= 61)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Largest -",
- "This gadget toggles between displaying the largest memory\n"
- "block available on your system.", NULL);
- break;
- }
-
- /*-----------------------*/
- /* Check GD_LARGESTFAST: */
- /*-----------------------*/
- if (x >= 434 && x <= 459 && y >= 40 && y <= 50)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Largest Fast -",
- "This gadget toggles between displaying the largest *Fast*\n"
- "memory block available on your system.", NULL);
- break;
- }
-
- /*-----------------------*/
- /* Check GD_LARGESTCHIP: */
- /*-----------------------*/
- if (x >= 434 && x <= 459 && y >= 29 && y <= 39)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Largest Chip -",
- "This gadget toggles between displaying the largest *Chip*\n"
- "memory block available on your system.", NULL);
- break;
- }
-
- /*---------------------*/
- /* Check GD_DAYOFWEEK: */
- /*---------------------*/
- if (x >= 465 && x <= 490 && y >= 84 && y <= 94)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Day Of Week -",
- "This gadget toggles between displaying the day of week.\n"
- "Watcher will display the day of week localized according\n"
- "to your local settings, eg. Donnerstag or Monday etc.", NULL);
- break;
- }
-
- /*----------------*/
- /* Check GD_DATE: */
- /*----------------*/
- if (x >= 465 && x <= 490 && y >= 73 && y <= 83)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Date -",
- "This gadget toggles between displaying the date.\n"
- "The date is displayed as dd-mm-yy.", NULL);
- break;
- }
-
- /*----------------*/
- /* Check GD_TIME: */
- /*----------------*/
- if (x >= 465 && x <= 490 && y >= 62 && y <= 72)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Time -",
- "This gadget toggles between displaying the time.\n"
- "The time is displayed as hh:mm:ss.", NULL);
- break;
- }
-
- /*-----------------------*/
- /* Check GD_WINLEFTEDGE: */
- /*-----------------------*/
- if (x >= 222 && x <= 270 && y >= 46 && y <= 59)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Window LeftEdge -",
- "Here you enter the left edge position of the Watcher window.", NULL);
- break;
- }
-
- /*----------------------*/
- /* Check GD_WINTOPEDGE: */
- /*----------------------*/
- if (x >= 222 && x <= 270 && y >= 61 && y <= 74)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Window TopEdge -",
- "Here you enter the top edge position of the Watcher window.", NULL);
- break;
- }
-
- /*--------------------*/
- /* Check GD_WINWIDTH: */
- /*--------------------*/
- if (x >= 222 && x <= 270 && y >= 76 && y <= 89)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Window Width -",
- "Here you enter the width of the Watcher window. Use 0\n"
- "to make the Watcher window conform to maximum overscan.", NULL);
- break;
- }
-
- /*---------------------*/
- /* Check GD_UPDATESEC: */
- /*---------------------*/
- if (x >= 222 && x <= 270 && y >= 91 && y <= 104)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Update rate sec. -",
- "Here you enter the update rate in seconds. If you set\n"
- "this value to eg. '1', then Watcher will update it's\n"
- "display once a second. Note that the more frequent\n"
- "Watcher must update it's display, the more CPU Watcher\n"
- "eats.", NULL);
- break;
- }
-
- /*---------------------*/
- /* Check GD_UPDATEMIC: */
- /*---------------------*/
- if (x >= 222 && x <= 270 && y >= 106 && y <= 119)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Update rate mic. -",
- "Here you enter Watcher's update rate in microseconds.\n"
- "Usually this is left to zero - see help for Update rate sec.", NULL);
- break;
- }
-
- /*------------------------*/
- /* Check GD_NOJUMPGADGET: */
- /*------------------------*/
- if (x >= 465 && x <= 490 && y >= 51 && y <= 61)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - No Jump Gadget -",
- "By default Watcher will put a Zoom gadget rightmost\n"
- "on the title bar. Hitting this gadget causes Watcher\n"
- "to jump to the next public screen (if any). Since this\n"
- "gadget occupies space on the title bar, you can choose\n"
- "to omit this gadget by selecting this option.", NULL);
- break;
- }
-
- /*---------------*/
- /* Check GD_CPU: */
- /*---------------*/
- if (x >= 465 && x <= 490 && y >= 40 && y <= 50)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Cpu -",
- "This toggles between displaying your system's CPU load.\n"
- "The CPU load indicates how busy in percent your CPU is.", NULL);
- break;
- }
- /*------------------------*/
- /* Check GD_PUBLICSCREEN: */
- /*------------------------*/
- if (x >= 140 && x <= 270 && y >= 121 && y <= 134)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Public Screen -",
- "Here you enter the name of the Public Screen you want\n"
- "Watcher to initially open on. If you leave this gadget\n"
- "empty Watcher will initially open on the Workbench.", NULL);
- break;
- }
-
- /*---------------------*/
- /* Check GD_GUIDEFILE: */
- /*---------------------*/
- if (x >= 140 && x <= 270 && y >= 136 && y <= 149)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Guide File -",
- "Here you enter the full path of the Watcher guide file.\n"
- "Watcher uses this guide file to display on-line help,\n"
- "that is whenever you press the HELP key when Watcher is\n"
- "active.", NULL);
- break;
- }
-
- /*-------------------------------*/
- /* Check GD_VOLUMEFREEDIRECTION: */
- /*-------------------------------*/
- if (x >= 465 && x <= 490 && y >= 29 && y <= 39)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Volume Free Direction -",
- "This gadget toggles between displaying Volume Free Direction\n"
- "Indicators. By default the characters '-', '^' and 'v' are\n"
- "used to indicate whether a volume is gaining (^) or loosing (v)\n"
- "free space, or whether it has not changed (-). This indicators\n"
- "are displayed immediately before the free space number on the\n"
- "title bar. See also the help for Volume Free Direction Indicators.", NULL);
- break;
- }
-
- /*-----------------------------------------*/
- /* Check GD_VOLUMEFREEDIRECTIONINDICATORS: */
- /*-----------------------------------------*/
- if (x >= 224 && x <= 270 && y >= 151 && y <= 164)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Volume Free Indicators -",
- "Here you specify the three volume free indicator values. The\n"
- "first character is the character to use when there is no change\n"
- "in the volumes free space (defaults to '-'). The second\n"
- "character is displayed when the volume is gaining space (defaults\n"
- "to '^'). The last character is used to indicate when the volume\n"
- "is loosing space (defaults to 'v').", NULL);
- break;
- }
-
- /*-----------------------*/
- /* Check GD_VOLUMEALERT: */
- /*-----------------------*/
- if (x >= 140 && x <= 270 && y >= 166 && y <= 179)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Volume Alert -",
- "Here you enter which volumes you would like to get alerts\n"
- "for. This means that if enter eg. SYS:-m1,WORK:-m5, then\n"
- "you will be notified with a requester whenever SYS: hits\n"
- "or gets below 1 MB of free space, and for WORK: this limit\n"
- "is set to 5 MB in our example.", NULL);
- break;
- }
-
- /*----------------*/
- /* Check GD_SAVE: */
- /*----------------*/
- if (x >= 8 && x <= 98 && y >= 217 && y <= 231)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Save -",
- "This will save the current settings and make the permanent.\n"
- "This means that the file Watcher.prefs will be written to\n"
- "both ENVARC: and ENV:.", NULL);
- break;
- }
-
- /*---------------*/
- /* Check GD_USE: */
- /*---------------*/
- if (x >= 271 && x <= 361 && y >= 217 && y <= 231)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Use -",
- "This will save the current settings to ENV:Watcher.prefs,\n"
- "meaning that the settings will not be permanent, and only\n"
- "have effect until the next time you reboot your machine.", NULL);
- break;
- }
-
- /*------------------*/
- /* Check GD_CANCEL: */
- /*------------------*/
- if (x >= 531 && x <= 621 && y >= 217 && y <= 231)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Cancel -",
- "This will cancel your current settings and *NOT* save\n"
- "the settings to disk.", NULL);
- break;
- }
-
- /*------------------------*/
- /* Check GD_GUIDEFILEGET: */
- /*------------------------*/
- if (x >= 271 && x <= 290 && y >= 136 && y <= 149)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Get Guide File. -",
- "Hitting this gadget will invoke a file requester, asking\n"
- "you to choose where the Watcher.guide file is located. This\n"
- "file is used by Watcher to display context sensitive on-line\n"
- "help.", NULL);
- break;
- }
-
- /*---------------------------*/
- /* Check GD_APPINFOLEFTEDGE: */
- /*---------------------------*/
- if (x >= 221 && x <= 269 && y >= 180 && y <= 193)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - App Info Left Edge -",
- "Here you specify the initial Left Edge of the App Info icon.\n"
- "This enables you to position the App Info icon at your preferred\n"
- "position. Using 0, 0 as the top and left edge, will position\n"
- "the appicon at a free position closest to 0, 0.", NULL);
- break;
- }
-
- /*--------------------------*/
- /* Check GD_APPINFOTOPEDGE: */
- /*--------------------------*/
- if (x >= 221 && x <= 269 && y >= 194 && y <= 207)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - App Info Top Edge -",
- "Here you specify the initial Top Edge of the App Info icon.\n"
- "This enables you to position the App Info icon at your preferred\n"
- "position.Using 0, 0 as the top and left edge, will position\n"
- "the appicon at a free position closest to 0, 0.", NULL);
- break;
- }
-
- /*----------------------------*/
- /* Check GD_APPINFOAUTOSTART: */
- /*----------------------------*/
- if (x >= 434 && x <= 459 && y >= 95 && y <= 105)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - App Info autostart -",
- "Here you specify if you want the App Info to start automatically.\n"
- "This means that when Watcher starts up, the App Info icon is\n"
- "automatically activated. You can ofcourse specify the opposite by\n"
- "disabling this feature.", NULL);
- break;
- }
-
- /*-----------------------*/
- /* Check GD_DATE_FORMAT: */
- /*-----------------------*/
- if (x >= 360 && x < 459 && y >= 106 && y <= 119)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Date Format -",
- "This gadget let's you specify the format of the displayed date.", NULL);
- break;
- }
-
- /*-----------------------*/
- /* Check GD_TIME_FORMAT: */
- /*-----------------------*/
- if (x >= 465 && x < 490 && y >= 95 && y <= 105)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - 24 Hour Clock -",
- "This gadget let's you specify if you want a 24 hour or 12 hour\n"
- "clock displayed in the window of Watcher.", NULL);
- break;
- }
-
- /*--------------------*/
- /* Check GD_LANGUAGE: */
- /*--------------------*/
- if (x >= 465 && x < 615 && y >= 106 && y <= 193)
- {
- Inform (WatcherPrefsWnd, "Help on gadget - Date Format -",
- "Here you can specify which language you want Watcher to use.\n"
- "NOTE! Changing language will first have effect when you quit,\n"
- " and restart Watcher.", NULL);
- break;
- }
-
- /*-------------------------------------------------*/
- /* If we enter here, the use is not over a gadget. */
- /*-------------------------------------------------*/
- Inform (WatcherPrefsWnd, "WatcherPrefs Help System:",
- "You have hit help without placing the mouse pointer over a\n"
- "gadget or invoking the menu. In order to get help, simply\n"
- "place your mouse pointer of the desired gadget and press\n"
- "help. Menu help is also available, select the menu item with\n"
- "the right mouse button and press help while still holding\n"
- "down the right mouse button.", NULL);
- break;
- }
- }
- return (1);
- }
-